{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入正确数字，且数字不能为零\n"
     ]
    }
   ],
   "source": [
    "try:\n",
    "    x = int(input(\"请输入一个整数：\"))\n",
    "    y = int(input(\"请输入一个整数：\"))\n",
    "    z = x /y\n",
    "except:\n",
    "    print(\"请输入正确数字，且数字不能为零\")\n",
    "else:\n",
    "    print(z)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "75\n",
      "65\n",
      "100 55 839\n",
      "[55, 65, 68, 75, 85, 95, 97, 99, 100, 100]\n",
      "[95, 68, 75, 100, 55, 99, 85, 100, 65, 97, 50]\n",
      "[95, 68, 75, 100, 55, 60, 99, 85, 100, 65, 97, 50]\n",
      "4\n",
      "[50, 97, 65, 100, 85, 99, 60, 100, 75, 68, 95]\n",
      "[50, 97, 65, 100, 85, 99, 60, 100, 75, 68, 95]\n",
      "[]\n"
     ]
    }
   ],
   "source": [
    "list1 = [95,68,75,88,55,99,85,100,65,97]\n",
    "print(list1[2])\n",
    "print(list1[-2])\n",
    "list1[3]=100\n",
    "# 方式1 \n",
    "# for i in range(len(list1)):\n",
    "    # print(list1[i])\n",
    "# 方式2    \n",
    "# for i in list1:\n",
    "    # print(i)\n",
    "print(max(list1),min(list1),sum(list1))\n",
    "print(sorted(list1))\n",
    "list1.append(50)\n",
    "print(list1)\n",
    "list1.insert(5,60)\n",
    "print(list1)\n",
    "list1.pop(4)\n",
    "print(list1.index(60))\n",
    "list1.reverse()\n",
    "print(list1)\n",
    "list2 = list1.copy()\n",
    "print(list2)\n",
    "list1.clear()\n",
    "print(list1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
